package com.xwj.dao.database1;

import com.xwj.domain.database1.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

/**
 * @author xwj
 * @date 2020/12/11
 */
@Mapper
@Repository
public interface OrderMapper {
    /**
     * 新建订单
     *
     * @param order
     * @return
     */
    @Insert("insert into t_order(user_id,product_id,count,money,status) values(#{userId},#{productId},#{count},#{money},0)")
    @Options(useGeneratedKeys = true, keyColumn = "id")
    int create(Order order);
}
